/*
 * main.cpp
 *
 *  Calculate miles a car has run during the last year.
 *  ask for:
 *  	counter_today
 *  	counter_last_year
 *  	gas_consumed
 *
 *
 *
 */

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>

using namespace std;

int main() {

	const float grans = 50000., pro1=0.1, pro2=0.15;
	vector<string> namn;
	vector<float> tab;

	string nn;
	float belopp, arvode;

	while(cin >> belopp >> ws){
		getline(cin, nn);
		int i;
		for(i = 0; i < namn.size() && nn != namn[i]; i++)
			;

		if(i == namn.size()){
			namn.push_back(nn);
			tab.push_back(belopp);
		} else {
			tab[i] += belopp;
		}

		cout << endl
			 << "Belopp    Arvode    Namn" << endl
			 << "======    ======    ====" << endl;

		for(int j = 0; j < namn.size(); j++){
			if(tab[j] <= grans)
				arvode = pro1*tab[j];
			else
				arvode = pro1*grans + pro2*(tab[j] - grans);
			cout << setiosflags(ios::fixed) << setprecision(0)
				 << setw(5) << tab[j] << setw(5) << arvode
				 << "     " << namn[j] << endl;



		}

	}


	return 0;
}
